package model;

import java.util.Date;
import java.util.Objects;

/**
 * PackageName: model
 * ClassName: FileInformation
 * Author: tum0r
 * Time: 2020/5/23 15:32
 */
public class FileInformation extends BaseModel {

    private String Name;
    private String Type;
    private Date CreateTime;
    private Date LastAccessTime;
    private String Label;
    private String ContentID;

    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = Objects.requireNonNullElseGet(name, String::new);
    }

    public String getType() {
        return Type;
    }

    public void setType(String type) {
        Type = Objects.requireNonNullElseGet(type, String::new);
    }

    public Date getCreateTime() {
        return CreateTime;
    }

    public void setCreateTime(Date createTime) {
        CreateTime = Objects.requireNonNullElseGet(createTime, Date::new);
    }

    public Date getLastAccessTime() {
        return LastAccessTime;
    }

    public void setLastAccessTime(Date lastAccessTime) {
        LastAccessTime = Objects.requireNonNullElseGet(lastAccessTime, Date::new);
    }

    public String getLabel() {
        return Label;
    }

    public void setLabel(String label) {
        Label = Objects.requireNonNullElseGet(label, String::new);
    }

    public String getContentID() {
        return ContentID;
    }

    public void setContentID(String contentID) {
        ContentID = Objects.requireNonNullElseGet(contentID, String::new);
    }

    public FileInformation(String UUID, String name, String type, Date createTime, Date lastAccessTime, String label, String contentID, double fileSize) {
        setUUID(UUID);
        setName(name);
        setType(type);
        setCreateTime(createTime);
        setLastAccessTime(lastAccessTime);
        setLabel(label);
        setContentID(contentID);
        setSize(fileSize);
    }

    public FileInformation() {
        super();
        setName("");
        setType("");
        setCreateTime(new Date(0));
        setLastAccessTime(new Date(0));
        setLabel("");
        setContentID("");
    }

    @Override
    public String toString() {
        return "FileInformation{" +
                "Name='" + Name + '\'' +
                ", Type='" + Type + '\'' +
                ", CreateTime=" + CreateTime +
                ", LastAccessTime=" + LastAccessTime +
                ", Label='" + Label + '\'' +
                ", ContentID='" + ContentID + '\'' +
                ", UUID='" + UUID + '\'' +
                ", Size=" + Size +
                ", Unit='" + Unit + '\'' +
                '}';
    }
}
